use salvo::{handler, Depot, Request};

use crate::config::api_config::ApiResult;
use crate::service::role_service::RoleService;

#[handler]
#[tracing::instrument]
pub async fn add_role(request: &mut Request, depot: &mut Depot) -> ApiResult<()> {
    ApiResult::from(RoleService::add_role(request, depot).await)
}

#[handler]
#[tracing::instrument]
pub async fn del_role(request: &mut Request, depot: &mut Depot) -> ApiResult<()> {
    ApiResult::from(RoleService::del_role(request, depot).await)
}
